<template>
    <div class="pjt-mt-details-view">

      <modules-title class="title-position" :titleName="title">

        <template slot="btn">

          <el-button
            plain
            size="mini"
            @click="goBack">返回</el-button>

          <el-button
            v-if="datas.project_phases_id == 1 && datas.status == 78 && !datas.son_id && isCreator"
            type="primary"
            size="mini"
            @click="startNext">
            启动临床阶段
          </el-button>

          <template v-if="isPerson">

            <el-button
              v-if="datas.status == 4 || datas.status == 52"
              type="primary"
              size="mini"
              @click="editClick">
              设置计划
            </el-button>

            <el-button
              v-if="datas.status == 4 || datas.status == 52"
              type="primary"
              size="mini"
              @click="auditProject">提交审批</el-button>

            <el-button
              v-if="datas.status == 1 || datas.status == 32"
              type="primary"
              size="mini"
              @click="confirmPlanBook">提交方案书</el-button>

            <el-button
              v-if="datas.status == 2"
              type="primary"
              size="mini"
              @click="planBookCheck">提交方案审批</el-button>

            <el-button
              v-if="datas.status == 2"
              type="primary"
              size="mini"
              @click="createMeeting">发起会议</el-button>

            <el-button
              v-if="datas.status == 6 || datas.status == 62 || datas.status == 64 || datas.status == 72"
              type="primary"
              size="mini"
              @click="stopClick">暂停/终止</el-button>

            <el-button
              v-if="datas.status == 8"
              type="primary"
              size="mini"
              @click="refreshClick">重启项目</el-button>

            <el-button
              v-if="(datas.status == 6 || datas.status == 62 || datas.status == 64 || datas.status == 72) && changeBase"
              type="primary"
              size="mini"
              @click="changeClick">申请变更</el-button>

            <el-button
              v-if="datas.status == 6 || datas.status == 72 || datas.status == 62 || datas.status == 64 || datas.status == 76"
              type="primary"
              size="mini"
              @click="acceptanceClick">提交验收报告</el-button>

            <el-button
              v-if="datas.status == 71"
              type="primary"
              size="mini"
              @click="createMeeting1">发起会议</el-button>

            <el-button
              v-if="datas.status == 74 || datas.status == 79"
              type="primary"
              size="mini"
              @click="endClick">项目结题</el-button>

          </template>

          <el-select
            v-if="(datas.project_phases_id == 2 && datas.parent_id) || (datas.project_phases_id == 1 && datas.son_id)"
            v-model="phases"
            placeholder="请选择阶段"
            size="small"
            @change="phasesChange"
          >
            <el-option
              v-for="dict in phasesOptions"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>

        </template>

      </modules-title>

      <div class="pj-content">
        <el-tabs class="project-tabs" v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="项目概览" name="overview" v-if="datas.status > 5 && datas.status != 52 && datas.status != 32 && datas.status != 53">
            <overview ref="overview" :datas="datas"></overview>
          </el-tab-pane>
          <el-tab-pane label="基本信息" name="first">
            <information-view style="background-color: white;padding: 10px" :datas="datas" is-other></information-view>
          </el-tab-pane>
          <el-tab-pane label="项目成员" name="second" v-if="datas.status > 4 && datas.status != 32">
            <members style="background-color: white;padding: 10px" :datas="datas" :is-disable="isDisable"></members>
          </el-tab-pane>
          <el-tab-pane label="项目任务" name="third" v-if="datas.status > 4 && datas.status != 32">
            <plan-view style="background-color: white;padding: 10px" ref="planList" :datas="datas" :is-disable="isDisable" :change-task="changeTask"></plan-view>
          </el-tab-pane>
          <el-tab-pane label="交付物清单" name="document" v-if="datas.status > 4 && datas.status != 52 && datas.status != 32">
            <document-view style="background-color: white;padding: 10px" ref="document" :project="datas" :is-disable="isDisable"></document-view>
          </el-tab-pane>
          <el-tab-pane label="项目问题" name="problem" v-if="datas.status > 5 && datas.status != 52 && datas.status != 32 && datas.status != 53">
            <problem-view style="background-color: white;padding: 10px" ref="problem" is-project :person="{id:datas.project_person_in_charge_id,name:datas.project_person_in_charge}" :project-id="datas.id" :project-name="datas.project_name" :task-list="taskList" :is-disbale="isDisable"></problem-view>
          </el-tab-pane>
          <el-tab-pane label="项目事务" name="six" v-if="datas.status > 5 && datas.status != 52 && datas.status != 32 && datas.status != 53">
            <affair-view style="background-color: white;padding: 10px" ref="affair" :datas="datas"></affair-view>
          </el-tab-pane>
          <el-tab-pane label="项目基线" name="version" v-if="datas.status > 5 && datas.status != 52 && datas.status != 32 && datas.status != 53">
            <version-view style="background-color: white;padding: 10px" ref="version" :datas="datas"></version-view>
          </el-tab-pane>
          <el-tab-pane label="验收报告" name="checkReport" v-if="datas.status == 71 || datas.status == 74 || datas.status == 75 || datas.status == 76 || datas.status == 77 || datas.status == 78 || datas.status == 79">
            <check-report style="background-color: white;padding: 10px" ref="checkReport" :datas="datas"></check-report>
          </el-tab-pane>
        </el-tabs>
      </div>

      <el-dialog
        v-if="stopVisible"
        title="项目暂停/终止"
        :visible.sync="stopVisible"
        width="700px"
        append-to-body
        :before-close="stopClose">

        <stop-and-pause-view ref="stopView" :project="datas" :pause="datas.status == 8"></stop-and-pause-view>

        <span slot="footer" class="dialog-footer">
          <el-button @click="stopVisible = false">取 消</el-button>
          <el-button type="primary" @click="stopConfirm">确 定</el-button>
        </span>
      </el-dialog>

      <el-dialog
        v-if="dialogVisible"
        title="项目变更申请"
        :visible.sync="dialogVisible"
        width="750px"
        append-to-body
        :before-close="dialogClose">

        <project-change ref="projectChange"></project-change>

        <span slot="footer" class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="applyConfirm">确 定</el-button>
        </span>
      </el-dialog>

<!--      <el-dialog-->
<!--        v-if="endVisible"-->
<!--        title="项目验收申请"-->
<!--        :visible.sync="endVisible"-->
<!--        width="750px"-->
<!--        append-to-body-->
<!--        :before-close="endClose">-->

<!--        <div>-->

<!--          <el-form ref="form" :model="form" label-width="150px">-->

<!--            <el-form-item label="项目验收报告">-->
<!--              <upload ref="upload" :edit-list="form.report" @uploadSuccess="uploadSuccess" @deleteSuccess="deleteSuccess"/>-->
<!--            </el-form-item>-->

<!--            <el-form-item label="项目验收材料">-->
<!--              <el-checkbox v-model="form.check_files_offline">线下提交</el-checkbox>-->
<!--              <upload ref="upload1" v-if="!form.check_files_offline" :edit-list="form.check_files" :limit="6" @uploadSuccess="uploadSuccess1" @deleteSuccess="deleteSuccess1" />-->
<!--            </el-form-item>-->

<!--          </el-form>-->

<!--        </div>-->


<!--        <span slot="footer" class="dialog-footer">-->
<!--          <el-button @click="endVisible = false">取 消</el-button>-->
<!--          <el-button type="primary" @click="endConfirm">确 定</el-button>-->
<!--        </span>-->
<!--      </el-dialog>-->

      <plan-book-edit-view ref="planBookView" @confirmDataBack="confirmDataBack"></plan-book-edit-view>

      <project-person ref="person" :datas="person" @success="confirmClick"></project-person>

      <project-end-dialog ref="endDialog" @update="updateProject"></project-end-dialog>

      <project-report-dialog ref="reportDialog" @update="updateProject"></project-report-dialog>


    </div>
</template>

<script>
  import projectReportDialog from "../modules/projectReportDialog";
  import projectEndDialog from "../modules/projectEndDialog";
  import checkReport from "./modules/checkReport";
  import overview from "./modules/overview";
  import projectPerson from "../modules/projectPerson";
  import planBookEditView from "../edit/modules/planBookEditView";
  import projectChange from "./modules/projectChange";
  import stopAndPauseView from "../modules/stopAndPauseView";
  import versionView from "./modules/versionView/index"
  import problemView from "./modules/taskListView/modules/problemView";
  import affairView from "./modules/affairView/index";
  import documentView from "./modules/documentView";
  import planView from "./modules/planView";
  import members from "./modules/members";
  import informationView from "./modules/informationView";
    export default {
        name: "index",
        components:{projectPerson,
            overview,
            informationView,
            members,
            checkReport,
            projectEndDialog,
            projectReportDialog,
            planView,documentView,affairView,problemView,versionView,stopAndPauseView,projectChange,planBookEditView},
        data:function () {
            return{
                title:'项目详情',
                changeBase:true,
                changeTask:true,
                isPerson:false,
                isCreator:false,
                activeName:'first',
                datas:{},
                taskList:[],
                phasesOptions: [
                    {
                        label: "临床前研究",
                        value: "1",
                    },
                    {
                        label: "临床研究",
                        value: "2",
                    },
                ],
                phases:"2",

                stopVisible:false,

                isNewFiles:false,

                dialogVisible:false,

                endVisible:false,
                form:{
                    report:[],
                    check_files:[],
                    check_files_offline:false,
                },

                isDisable:false,

                person:{},

                isCreate:true,

                bb:'1'

            }
        },
        created:function(){
            if (this.$route.query.id){
                this.getData(this.$route.query.id)
                this.$api.PROJECT_START_CHANGE_FLAG(this.$route.query.id).then(res=>{
                    if (res.code == 200){
                        if (res.data && res.data.exist){
                            this.changeBase = false;
                        }
                        if (res.data && res.data.tasks_exist){
                            this.changeTask = false;
                        }

                    }
                })
            }
        },
        activated:function(){

            if (this.isCreate){
                this.isCreate = false
            }else {
                if (this.datas.id){
                    this.getData(this.datas.id)
                    this.$api.PROJECT_START_CHANGE_FLAG(this.datas.id).then(res=>{
                        if (res.code == 200){
                            if (res.data && res.data.exist){
                                this.changeBase = false;
                            }
                            if (res.data && res.data.tasks_exist){
                                this.changeTask = false;
                            }

                        }
                    })
                }else {
                    this.getData(this.$route.query.id)
                    this.$api.PROJECT_START_CHANGE_FLAG(this.$route.query.id).then(res=>{
                        if (res.code == 200){
                            if (res.data && res.data.exist){
                                this.changeBase = false;
                            }
                            if (res.data && res.data.tasks_exist){
                                this.changeTask = false;
                            }

                        }
                    })
                }
            }
        },
        mounted:function() {

        },
        methods:{
            updateProject:function(){
                this.getData(this.$route.query.id)
            },
            startNext:function (id) {
                this.person = {
                    id:this.datas.id,
                    value:[],
                    project_person_in_charge_id:'',
                    project_person_in_charge:'',
                }

                if (this.$refs.person){
                    this.$refs.person.openDialog()
                }
            },
            confirmClick:function () {

                this.$api.PROJECT_MANAGER_PROJECT_CREATE_STAGE(this.person).then(res=>{
                    if (res.code == 200){
                        // this.$router.push({name:"projectManagementEdit",query:{id:res.data}})
                        this.$route.params.refresh = true
                        this.$router.back()
                    }else {
                        this.$message.error(res.msg)
                    }
                })
            },
            checkPerson:function(){
                if (this.datas.project_person_in_charge_id == this.$store.getters.userInfo.user.id){
                    this.isPerson = true;
                }else{
                    this.isPerson = false
                }
                if (this.datas.creator_id == this.$store.getters.userInfo.user.id){
                    this.isCreator = true;
                }else{
                    this.isCreator = false
                }
            },
            getData:function(id){
                this.$api.PROJECT_MANAGER_PROJECT_DETAIL(id).then(res=>{
                    if (res.code == 200){
                        this.isNewFiles = true
                        this.datas = res.data;
                        this.getStateStr();
                        this.checkPerson()
                        if (this.datas.status == 8 || this.datas.status == 9 || this.datas.status == 71 || this.datas.status == 74 || this.datas.status == 75 || this.datas.status == 76 || this.datas.status == 78 || this.datas.status == 53 || this.datas.status == 5){
                            this.isDisable = true
                        }else{
                            this.isDisable = false
                        }

                        this.phases = this.datas.project_phases_id
                        if (this.datas.project_task){
                            this.taskList = []
                            this.dealTaskData(this.datas.project_task)
                        }
                        if (this.$refs.planList){
                            this.$refs.planList.setData(this.datas);
                        }
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            },
            getStateStr:function(){
                let str = "";
                switch (this.datas.status) {
                    case 1:
                        str = "启动中(待提交方案)"
                        break;
                    case 2:
                        str = "启动中(方案评审)"
                        break;
                    case 3:
                        str = "方案评审中"
                        break;
                    case 32:
                        str = "审批拒绝"
                        break;
                    case 4:
                        str = "计划阶段"
                        break;
                    case 5:
                        str = "计划审批中"
                        break;
                    case 52:
                        str = "审批拒绝"
                        break;
                    case 53:
                        str = "待项目开始"
                        break;
                    case 6:
                        str = "进行中"
                        break;
                    case 61:
                        str = "暂停审批中"
                        break;
                    case 62:
                        str = "暂停审批拒绝"
                        break;
                    case 63:
                        str = "终止审批中"
                        break;
                    case 64:
                        str = "终止审批拒绝"
                        break;
                    case 7:
                        str = "项目材料报告验收中"
                        break;
                    case 8:
                        str = "已暂停"
                        break;
                    case 9:
                        str = "已终止"
                        break;
                    case 71:
                        str = "验收评审"
                        break;
                    case 72:
                        str = "材料审核未通过"
                        break;
                    case 74:
                        str = "结题会议通过"
                        break;
                    case 75:
                        str = "验收不合格"
                        break;
                    case 76:
                        str = "整改再验收"
                        break;
                    case 77:
                        str = "结题验收中"
                        break;
                    case 78:
                        str = "结题验收通过"
                        break;
                    case 79:
                        str = "结题验收驳回"
                        break;
                    default:
                        break;
                }
                if (str){
                    this.title = "项目详情(" + str + ")"
                }

            },
            handleClick:function () {

                if (this.activeName == "problem"){
                    if (this.$refs.problem){
                        this.$refs.problem.getListData();
                    }
                }else if (this.activeName == "document"){
                    if (this.$refs.document && this.isNewFiles){
                        if (this.datas){
                            this.isNewFiles = false
                            this.$refs.document.setData(this.datas)
                        }
                    }
                }else if (this.activeName == "version"){
                    if (this.$refs.version){
                        this.$refs.version.getListData();
                    }
                }else if (this.activeName == "overview"){
                    if (this.$refs.overview){
                        this.$refs.overview.resize()
                    }
                }else if (this.activeName == "six"){
                    if (this.$refs.affair){
                        this.$refs.affair.getData()
                    }
                }
            },
            goBack:function () {
                this.$back()

            },
            submitClick:function () {

            },
            dealTaskData:function (list) {
                for (let i = 0; i < list.length; i++){
                    this.taskList.push(list[i])
                    if (list[i].children && list[i].children.length > 0){
                        this.dealTaskData(list[i].children);
                    }
                }
            },
            phasesChange:function (value) {
                if (value == 1){
                    console.log(this.datas.parent_id)

                    this.getData(this.datas.parent_id)
                }else {
                    console.log(this.datas.son_id)
                    this.getData(this.datas.son_id)
                }
                this.activeName = "first"
            },
            createMeeting1:function(){

                this.$comFun.goMeetingCreate(5,{id:this.datas.id,name:this.datas.project_name})

            },
            endClick:function(){
                if (this.$refs.endDialog){
                    this.$refs.endDialog.showDialog(this.datas)
                }
            },
            acceptanceClick:function () {

                if (this.datas.project_task){
                    for (let i = 0; i < this.datas.project_task.length; i++){
                        if (this.datas.project_task[i].status != 6){
                            this.$message.error("请先完成里程碑" + this.datas.project_task[i].task_name);
                            return;
                        }
                    }
                }

                if (this.$refs.reportDialog){
                    this.$refs.reportDialog.showDialog(this.datas)
                }
            },
            deleteSuccess() {
                this.form.report = this.$refs.upload.emitFileList()
            },
            uploadSuccess() {
                this.form.report = this.$refs.upload.emitFileList()
            },
            deleteSuccess1() {
                this.form.check_files = this.$refs.upload1.emitFileList()
            },
            uploadSuccess1() {
                this.form.check_files = this.$refs.upload1.emitFileList()
            },
            endClose:function(){
                this.endVisible = false;
                this.form.report = []
                this.form.check_files = []
                this.form.check_files_offline = false;
            },
            endConfirm:function(){
                if (!this.form.report.length){
                    this.$message.error("请提交验收报告");
                    return
                }
                if (!this.form.check_files_offline && !this.form.check_files.length){
                    this.$message.error("请提交项目验收材料");
                    return
                }
                this.endVisible = false;
                let data = {...this.form}
                data.check_files_offline = Number(data.check_files_offline)
                this.$api.PROJECT_MANAGER_PROJECT_END_CHECK(this.datas.id,data).then(res=>{
                    if (res.code == 200){
                        this.$message.success("提交成功")
                        this.$route.params.refresh = true;
                        this.getData(this.datas.id);
                    }else {
                        this.$message.error(res.msg);
                    }
                })
                this.form.report = []
                this.form.check_files = []
                this.form.check_files_offline = false;
            },
            changeClick:function(){

                this.dialogVisible = true;

                setTimeout(() => {
                    if (this.$refs.projectChange){
                        this.$refs.projectChange.setData(this.datas)
                    }
                },100)
            },
            dialogClose:function(){
                this.dialogVisible = false;
            },
            applyConfirm:function(){
                if (this.$refs.projectChange){
                    this.$refs.projectChange.validateForm().then(value=>{
                        if (value){

                            if ((this.$refs.projectChange.formData.startDate == this.datas.plan_start_time) &&
                                (this.$refs.projectChange.formData.duration == this.datas.duration) &&
                                (this.$refs.projectChange.formData.project_person_in_charge_id == this.datas.project_person_in_charge_id)){
                                this.$message.warning("项目信息未变更，无法提交")
                                return
                            }

                            let data = {
                                object_id:this.datas.id,
                                project_id:this.datas.id,
                                project_name:this.datas.project_name,
                                change_type:1,
                                reason_id:this.$refs.projectChange.formData.change_cause_id,
                                reason:this.$refs.projectChange.formData.change_cause,
                                description:this.$refs.projectChange.formData.details_describe,
                                level_id:this.$refs.projectChange.formData.change_level_id,
                                level:this.$refs.projectChange.formData.change_level,
                                change_describe:this.$refs.projectChange.formData.change_describe,
                                files:this.$refs.projectChange.formData.files,
                                project_after:{
                                    set_base_line:0,
                                    son_change_type:1,
                                    project_person_in_charge_id:this.$refs.projectChange.formData.project_person_in_charge_id,
                                    project_person_in_charge:this.$refs.projectChange.formData.project_person_in_charge,
                                    plan_start_time:this.$refs.projectChange.formData.startDate,
                                    plan_end_time:this.$refs.projectChange.formData.endDate,
                                    duration:this.$refs.projectChange.formData.duration
                                }
                            }

                            this.$api.PROJECT_START_CHANGE_CREATE(data).then(res=>{
                                if (res.code == 200){
                                    this.changeBase = false
                                    this.$message.success("申请成功")
                                    this.getData(this.datas.id)
                                }else{
                                    this.$message.error(res.msg)
                                }
                            })
                            this.dialogVisible = false;
                        }
                    })
                }
            },
            editClick:function () {
                this.$router.push({name:"projectManagementEdit",query:{id:this.datas.id,t:new Date().getTime()}})
            },
            createMeeting:function(id){

                this.$comFun.goMeetingCreate(2,{id:this.datas.id,name:this.datas.project_name})
            },
            planBookCheck:function(){
                this.$api.PROJECT_MANAGER_PROJECT_STATUS(this.datas.id,3).then(res=>{
                    if (res.code == 200){
                        this.$message.success("成功")
                        // this.getData(this.datas.id)
                        this.$route.params.refresh = true;

                        if (window.history.length > 1) {
                            this.$router.back();
                        } else {
                            this.$router.push('/projectManagement/project/list');
                        }
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            },
            confirmPlanBook:function(){
                if (this.$refs.planBookView){
                    this.$refs.planBookView.openDialog(this.datas);
                }
            },
            confirmDataBack (data) {

                this.$api.PROJECT_START_PROJECT_UPDATE_BOOK(this.datas.id,{project_design_book:data}).then(res=>{
                    if (res.code == 200){
                        this.$message.success("成功")
                        this.$route.params.refresh = true;
                        this.getData(this.$route.query.id)
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            },
            auditProject:function(){
                if (!this.projectValidate(this.datas)){
                    return;
                }

                this.$api.PROJECT_MANAGER_PROJECT_STATUS(this.datas.id,5).then(res=>{
                    if (res.code == 200){
                        this.$message.success("成功")
                        // this.getData(this.datas.id)
                        this.$route.params.refresh = true;
                        this.$router.back()
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            },
            projectValidate:function(data){

                if (!data.member || data.member.length == 0){
                    //
                    this.$message({
                        message: '请添加项目组成员',
                        type: 'warning'
                    })
                    return false;
                }
                if (!data.project_template_id){
                    this.$message({
                        message: '请选择项目模板',
                        type: 'warning'
                    })
                    return false;
                }
                if (!data.plan_start_time){
                    this.$message({
                        message: '请选择项目开始时间',
                        type: 'warning'
                    })
                    return false;
                }
                if (!data.plan_end_time){
                    this.$message({
                        message: '请选择项目结束时间',
                        type: 'warning'
                    })
                    return false;
                }
                if (!data.duration){
                    this.$message({
                        message: '请设置项目工期',
                        type: 'warning'
                    })
                    return false;
                }

                if (!data.project_task || !data.project_task.length){
                    this.$message({
                        message: '请添加里程碑',
                        type: 'warning'
                    })
                    return false;
                }
                if (!this.checkTaskData(data.project_task,data.plan_start_time,data.plan_end_time)){
                    return false;
                }

                return true;
            },
            checkTaskData:function(list,s_time,e_time){
                for (let i = 0; i < list.length; i++){
                    let data = list[i];

                    if (!data.task_name){
                        this.$message({
                            message: '请添加任务名称',
                            type: 'warning'
                        })
                        return false;
                    }
                    if (!data.start_date){
                        this.$message({
                            message: "请设置" + data.task_name + "的起始时间",
                            type: 'warning'
                        })
                        return false;
                    }
                    if (!data.end_date){
                        this.$message({
                            message: "请设置" + data.task_name + "的结束时间",
                            type: 'warning'
                        })
                        return false;
                    }
                    if (!data.duration){
                        this.$message({
                            message: "请设置" + data.task_name + "的工期",
                            type: 'warning'
                        })
                        return false;
                    }
                    if (!data.person_in_charge || !data.person_in_charge.member_id){
                        this.$message({
                            message: "请设置" + data.task_name + "的负责人",
                            type: 'warning'
                        })
                        return false;
                    }
                    if (!data.task_member_id || !data.task_member_id.length){
                        this.$message({
                            message: "请设置" + data.task_name + "的参与人",
                            type: 'warning'
                        })
                        return false;
                    }

                    if (new Date(data.start_date.replace(/-/g,'/')).getTime() < new Date(s_time.replace(/-/g,'/')).getTime()){
                        this.$message({
                            message: '请调整' + data.task_name + "的开始日期",
                            type: 'warning'
                        })
                        return false;
                    }

                    if (new Date(data.end_date.replace(/-/g,'/')).getTime() > new Date(e_time.replace(/-/g,'/')).getTime()){
                        this.$message({
                            message: '请调整' + data.task_name + "的结束日期",
                            type: 'warning'
                        })
                        return false;
                    }

                    if (data.children && data.children.length){
                        if (!this.checkTaskData(data.children,data.start_date,data.end_date)){
                            return false;
                        }
                    }
                }

                return true;
            },
            stopClick:function(){
                this.stopVisible = true;
            },
            stopClose:function () {
                this.stopVisible = false;
            },
            stopConfirm:function () {

                if (this.$refs.stopView){
                    this.$refs.stopView.validateFun().then(()=>{
                        this.stopVisible = false;
                        this.$api.PROJECT_START_PROJECT_STOP_CREATE(this.$refs.stopView.datas).then(res=>{
                            if (res.code == 200){
                                this.getData(this.datas.id);
                            }else {
                                this.$message.error(res.msg)
                            }
                        }).catch(err=>{

                        })
                    })
                }
            },
            refreshClick:function () {
                this.$api.PROJECT_MANAGER_PROJECT_STATUS(this.datas.id,10).then(res=>{
                    if (res.code == 200){
                        this.$message.success("成功")
                        this.getData(this.datas.id)
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            },
            aaaaa:function () {
                this.$api.PROJECT_MANAGER_PROJECT_STATUS(this.datas.id,4).then(res=>{
                    if (res.code == 200){
                        this.$message.success("成功")
                        this.getData(this.datas.id)
                    }else{
                        this.$message.error(res.msg)
                    }
                }).catch(err=>{

                })
            }
        }
    }
</script>

<style lang="scss">
  @import "../../../../assets/scss/views/projectManagement/list/details.scss";
</style>
